﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using MododorWebAPI.Models;

namespace MododorWebAPI.EntityConfigs
{
    public class UserEntityConfig : IEntityTypeConfiguration<UserModel>
    {
        public void Configure(EntityTypeBuilder<UserModel> builder)
        {
            builder.ToTable("User");
            builder.Property(x=>x.UserIV).IsRequired();
            builder.Property(x=>x.UserKey).IsRequired();
            builder.Property(x=>x.UserName).IsRequired();
            builder.Property(x=>x.UserPassword).IsRequired();
            builder.Property(x => x.UserEnable).HasDefaultValue(true);
        }
    }
}
